package cn.itcast.feign.api;

import cn.itcast.user.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 用户服务的Feign接口,用于完成用户服务的远程调用
 */

@FeignClient("userservice")//要调用的服务名称
//@FeignClient(value = "userservice", configuration = DefaultFeignConfiguration.class)

public interface UserFeign {

    //根据用户id查询用户信息
    @GetMapping("/user/{id}")//或者在接口前加@RequestMapping("/user")
    public User queryById(@PathVariable("id") Long id);


}
